
using System.IO;
using UnityEditor;
using UnityEngine;

public class 查看Gui来源
{
    [MenuItem("Assets/查看资源Gui]", false)]
    public static void LookGUI()
    {
        string path = AssetDatabase.GetAssetPath(Selection.activeObject);
        
        var 他的gui = AssetDatabase.AssetPathToGUID(path);
        var allPrefab = AssetDatabase.FindAssets("t:prefab");
        foreach (var VARIABLE in allPrefab)
        {
            string p = AssetDatabase.GUIDToAssetPath(VARIABLE);
            var content = File.ReadAllText(p);
            if (content.Contains(他的gui))
            {
                Debug.Log("有引用:"+p);
                Debug.Log("有引用:"+VARIABLE);
            }
        }
    }
}
